package com.ccb.cloud.rca.appservice.controller.reform;

import com.ccb.cloud.rca.appservice.dao.DO.reform.CgCheckBalanceSheet192DO;
import com.ccb.cloud.rca.appservice.dto.reform.CgCheckBalanceSheet192DTO;
import com.ccb.cloud.rca.appservice.service.reform.ICgCheckBalanceSheet192Service;
import com.ccb.cloud.rca.appservice.dto.ReqPaginationBase;
import com.ccb.cloud.rca.appservice.vo.ResultBean;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author yonggang.wang
 * @Description CgCheckBalanceSheet192Controller
 * @create 2021-11-29
 */
@RestController
@RequestMapping("/api/reform/cgCheckBalanceSheet192")
public class CgCheckBalanceSheet192Controller {

    private final static Logger LOGGER = LoggerFactory.getLogger(CgCheckBalanceSheet192Controller.class);

    @Autowired
    private ICgCheckBalanceSheet192Service cgCheckBalanceSheet192Service;

    /**
     * 新增对象
     * @param cgCheckBalanceSheet192dto
     * @return
     */
    @RequestMapping(value="/addObject",method= RequestMethod.POST)
    public ResultBean addObject(@RequestBody CgCheckBalanceSheet192DTO cgCheckBalanceSheet192dto){
        LOGGER.info("新增对象param=>{}",cgCheckBalanceSheet192dto);
        cgCheckBalanceSheet192Service.addObject(cgCheckBalanceSheet192dto);
        return ResultBean.getSuccessRs("");
    }
    /**
     * 修改对象
     * @param cgCheckBalanceSheet192dto
     * @return
     */
    @RequestMapping(value="/updateObject",method= RequestMethod.POST)
    public ResultBean updateObject(@RequestBody CgCheckBalanceSheet192DTO cgCheckBalanceSheet192dto){
        LOGGER.info("修改对象param=>{}",cgCheckBalanceSheet192dto);
        cgCheckBalanceSheet192Service.updateObject(cgCheckBalanceSheet192dto);
        return ResultBean.getSuccessRs("");
    }
    /**
     * 查询列表
     * @param cgCheckBalanceSheet192dto
     * @return
     */
    @RequestMapping(value="/queryList",method= RequestMethod.POST)
    public ResultBean findList(@RequestBody CgCheckBalanceSheet192DTO cgCheckBalanceSheet192dto){
        LOGGER.info("查询列表param=>{}",cgCheckBalanceSheet192dto);
        return ResultBean.getSuccessRs(cgCheckBalanceSheet192Service.queryList(cgCheckBalanceSheet192dto));
    }
    /**
     * 分页查询
     * @param cgCheckBalanceSheet192ReqPagination
     * @return
     */
    @RequestMapping(value="/queryPage",method= RequestMethod.POST)
    public ResultBean findPage(@RequestBody ReqPaginationBase<CgCheckBalanceSheet192DTO> cgCheckBalanceSheet192ReqPagination){
        LOGGER.info("分页查询param=>{}",cgCheckBalanceSheet192ReqPagination);
        return ResultBean.getSuccessRs(cgCheckBalanceSheet192Service.queryPage(cgCheckBalanceSheet192ReqPagination));
    }

    /**
     * 删除对象
     * @param cgCheckBalanceSheet192dto
     * @return
     */
    @RequestMapping(value="/deleteObject",method= RequestMethod.POST)
    public ResultBean deleteObject(@RequestBody CgCheckBalanceSheet192DTO cgCheckBalanceSheet192dto){
        LOGGER.info("删除对象param=>{}",cgCheckBalanceSheet192dto);
        cgCheckBalanceSheet192Service.deleteObject(cgCheckBalanceSheet192dto);
        return ResultBean.getSuccessRs("");
    }
    /**
     * 查询一条
     * @param cgCheckBalanceSheet192dto
     * @return
     */
    @RequestMapping(value="/queryDetail",method= RequestMethod.POST)
    public ResultBean findOne(@RequestBody CgCheckBalanceSheet192DTO cgCheckBalanceSheet192dto){
        LOGGER.info("查询一条param=>{}",cgCheckBalanceSheet192dto);
        return ResultBean.getSuccessRs(cgCheckBalanceSheet192Service.queryDetail(cgCheckBalanceSheet192dto));
    }
}
